UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcPluvo7SI2tBjPAb743VlgqA1mzLFvsSIqYKJ5KGm4='
WHERE
key_id = '3801105fe42f4545dc85544fb5575e3733769539064bae88863fe18dd926d342'
AND (
token = 'bcPluvo7SI2tBjPAb743VlgqA1mzLFvsSIqYKJ5KGm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)