UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OpL0rLJHP50XQYkmcTALQwZvjrhCHRv27Hn/CwXQi/I='
WHERE
key_id = 'ea703235c07e1737ad23bd04b730c6309f4f1d123840ea1f273ac67164627b39'
AND (
token = 'OpL0rLJHP50XQYkmcTALQwZvjrhCHRv27Hn/CwXQi/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)