UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'laywiP5ZVNaJ8ZJmvbNKjk82aLc/Cn+I+uhJJVSonjE=' 
WHERE 
  key_id = '38d11ebb2bc28f77c58fbb2a460fc067d6e3df67ac1d650c8ad90e23b30dbdd0' 
  AND (
    token = 'laywiP5ZVNaJ8ZJmvbNKjk82aLc/Cn+I+uhJJVSonjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00186