UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rVVcoV0KyA1DlShmAQtF1iU7i4yJYv6p6zUjlvxQkg=' 
WHERE 
  key_id = '0f52c5cae468821350ad9b3a38800825c22189fd604aac47f42ed746d042441e' 
  AND (
    token = '3rVVcoV0KyA1DlShmAQtF1iU7i4yJYv6p6zUjlvxQkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027