UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B0hcibEwXS1wdBF+eN2QZNdYDHx4Mum0zaYKdklqUKs='
WHERE
key_id = 'ee704424181955454b9e921ee71641aaa0e023fbe15de63b2f9aa2e3f2e4299b'
AND (
token = 'B0hcibEwXS1wdBF+eN2QZNdYDHx4Mum0zaYKdklqUKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)