UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qbl+2/QoVfJh1GS5649QNkqjXES7P6xEC9vU/IjNo9U=' 
WHERE 
  key_id = '3857dd5a6d4443e261018be29cebaf6c68caefade71d25a7b15b1fed11c97bd2' 
  AND (
    token = 'qbl+2/QoVfJh1GS5649QNkqjXES7P6xEC9vU/IjNo9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026