UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3fqS3DLqoDlCzrhx/kRu4kyDppg7u5a0uaixcVJBr9g=' 
WHERE 
  key_id = '6c6e6c90c40bae904c5f8317a6a69fea74aea603d8bc36b29593fe76529c3e23' 
  AND (
    token = '3fqS3DLqoDlCzrhx/kRu4kyDppg7u5a0uaixcVJBr9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031