UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'At1Zb1L6JVJbuORCK9FB3cXtMZ35hHaYC4dQ04aUdbI='
WHERE
key_id = 'ac1b8573dac615d81d101f794301730ec9dc4c2d4ee73e71a26595f07f79ab5c'
AND (
token = 'At1Zb1L6JVJbuORCK9FB3cXtMZ35hHaYC4dQ04aUdbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)