UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9LTUd4WLrBb/ZrqAsa7SfM70UuVCwVotkmJ5YBijUF4=' 
WHERE 
  key_id = 'a2be9f66739dcf808a33e2002a111e6ee49beb2973e364d80fa8cf21ec64c6ef' 
  AND (
    token = '9LTUd4WLrBb/ZrqAsa7SfM70UuVCwVotkmJ5YBijUF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025