UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '61MxSTMTGjIaXmwygXB4/MDNDAPdCUY5KkD4KSUwMDQ=' 
WHERE 
  key_id = 'a2f37209aa9be4be172f15ff6cb0fc658fc59fb8efd3cdb86fd8040c1a13b6cb' 
  AND (
    token = '61MxSTMTGjIaXmwygXB4/MDNDAPdCUY5KkD4KSUwMDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019