UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DckajUhE+Hj4AcwYn8UScz+4Ix/Q3kiqfpG5yihygTI='
WHERE
key_id = 'ead89a220050dcee3e7406150867dbc0bba2a749784a59a25bb9ebe52a621fce'
AND (
token = 'DckajUhE+Hj4AcwYn8UScz+4Ix/Q3kiqfpG5yihygTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)