UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wnGcsz2Bkb7h47cR02732ip0M2yLK6QjmTrU0elgAWo='
WHERE
key_id = '4aa211bcab31c0c735b0fe84ce98452264fc4b58ed55ed0a7ac62886c011e95c'
AND (
token = 'wnGcsz2Bkb7h47cR02732ip0M2yLK6QjmTrU0elgAWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)