UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vHD/lwxQ4Acy2XE9i2+uj+J9yVQSm4cRbnXp+CKvTjk='
WHERE
key_id = 'ed1b8ac90b99b87ef00b9197602011d2060fb9b0823f0b40097ebe914574e458'
AND (
token = 'vHD/lwxQ4Acy2XE9i2+uj+J9yVQSm4cRbnXp+CKvTjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)