UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YFsNRTpe4UYp5kg/THkygqkFTCtYPtq1kuNtIxbMZjE=' 
WHERE 
  key_id = '8f1a18fec592ad60e23edb8542e6fa3fcb01a95b466e8558b8ba221f2aaf2f55' 
  AND (
    token = 'YFsNRTpe4UYp5kg/THkygqkFTCtYPtq1kuNtIxbMZjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051