UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5rPu7/Bd6FeqZFPOkCuyVsUmMjPfIFdD4kypG+PABPU=' 
WHERE 
  key_id = '220c1c4ca7fb94a58377ecd5e466f65303c18d293ead763f06bd6c9566349020' 
  AND (
    token = '5rPu7/Bd6FeqZFPOkCuyVsUmMjPfIFdD4kypG+PABPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029