UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vis94FKsZdcqW37GTP4iVUkfqo+/TeJOMusXJJbjSBM=' 
WHERE 
  key_id = '32bb401160b29e10699e3d4abfe6ae7eabc4ff2d00d5b9947fc7fd2714d1b097' 
  AND (
    token = 'vis94FKsZdcqW37GTP4iVUkfqo+/TeJOMusXJJbjSBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038