UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvR9Q99cSbZxO5OztM6DUu/NOtxO8a00c6FF8MCa1rU='
WHERE
key_id = '3c38e98fc340bb06678ec04cd626c6954ddfbe96b3157070e2bde2e74fdfb450'
AND (
token = 'UvR9Q99cSbZxO5OztM6DUu/NOtxO8a00c6FF8MCa1rU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)