UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c4M7wooWJLzYXxdxjb3VC1fCKdapxxIXsGcTcUZMt+M=' 
WHERE 
  key_id = 'fdce03894857e49c641b9cba67a499c8cacc11e8bcbd349d0ed876f6aeac46a2' 
  AND (
    token = 'c4M7wooWJLzYXxdxjb3VC1fCKdapxxIXsGcTcUZMt+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024