UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Goow9/dPibY4DMfcyPwmPTxf5ms6K4kaIZ872eIRbvA='
WHERE
key_id = 'c4d31772ead879ebfbcdbdf3727701271b1f6883d6773f4ab8d876a032e06fa3'
AND (
token = 'Goow9/dPibY4DMfcyPwmPTxf5ms6K4kaIZ872eIRbvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)