UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wEL2ghDheBWn1UGXUsxbUIR128YOhXFKXr7/crqz/Hg='
WHERE
key_id = '52e7caeb6c6d3f109905c610675d096ba510d6b84be91dd9933b9686a2322922'
AND (
token = 'wEL2ghDheBWn1UGXUsxbUIR128YOhXFKXr7/crqz/Hg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)