UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3GEjLRaOEHZ/+AN3yoynQuVM7PyMeEfuWc6OAruzLHY='
WHERE
key_id = '5d8c4319d8bb0ad757decdc50c6151d091805470140730cb2054dbbf2398f88a'
AND (
token = '3GEjLRaOEHZ/+AN3yoynQuVM7PyMeEfuWc6OAruzLHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)