UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'po7KR5yQggVnvk6DG368g4y8u5AkbGkK5VbKh45KCPo=' 
WHERE 
  key_id = '6e0f2963fa5f092c61ecc42287face37552be876dbc0aa3ef68fa72db96ccfd5' 
  AND (
    token = 'po7KR5yQggVnvk6DG368g4y8u5AkbGkK5VbKh45KCPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034