UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4N4I/3jLCLX5ubMhtYyYjLVywuQKocW5xdSnzn8UkCY=' 
WHERE 
  key_id = '3d93e8f5101be6ca0582eee394a7be60fc2b2d027e278a87777ee78997157b18' 
  AND (
    token = '4N4I/3jLCLX5ubMhtYyYjLVywuQKocW5xdSnzn8UkCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046