UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oz/SOqf7EMB6w+hlq0qF/5i82szomSY0R0qywCnByQI=' 
WHERE 
  key_id = 'bd95c8e74b08d7ac34087010594c5a33832aed231b637a4e050937350cbb15ac' 
  AND (
    token = 'Oz/SOqf7EMB6w+hlq0qF/5i82szomSY0R0qywCnByQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040