UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0tZ/Glf/dvHkCcESTL1N2Spl+up3O8g6NFXBGdgOdP0='
WHERE
key_id = '7e8ffc2f28b360643551798b612584a54236647bb50256932979a74ef2d7a415'
AND (
token = '0tZ/Glf/dvHkCcESTL1N2Spl+up3O8g6NFXBGdgOdP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)