UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N2wq34rHbFl9LzpFQUtPdhcpHRQ8NV8eOnzfHXYB18I=' 
WHERE 
  key_id = 'df8fe28e5ecb6cd75faa87b59c8bf722782d215ce6f983b77923b940fdfe3d66' 
  AND (
    token = 'N2wq34rHbFl9LzpFQUtPdhcpHRQ8NV8eOnzfHXYB18I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107