UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5TZCpjN021z11jXJoEiZ5Aci0xdZFpB+3y7NrRvdu9M=' 
WHERE 
  key_id = '5fcb7fa107c4cd0b53c72b55d5117fef43380d2c51746aaf3e502de48e7ce6fa' 
  AND (
    token = '5TZCpjN021z11jXJoEiZ5Aci0xdZFpB+3y7NrRvdu9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022