UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dg/JHFdqL7K75KkcwVYBllokCwxI39mji+WUmnV/Bf0='
WHERE
key_id = 'a78fdcd57e6043eb2a7ed7bc1d2cb9f2df2bd63fa3280fcc8ad898d28572758c'
AND (
token = 'Dg/JHFdqL7K75KkcwVYBllokCwxI39mji+WUmnV/Bf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)