UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VhQ6BMgEYzUdWlTB2VJTaFU/g++ohL8ZwIkm/f9D+QY=' 
WHERE 
  key_id = 'a396699e65ba896baaf80b8768b2b10884a508e84d30d334a38c3d3a6d6f44b6' 
  AND (
    token = 'VhQ6BMgEYzUdWlTB2VJTaFU/g++ohL8ZwIkm/f9D+QY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029