UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '84r0MbxF5EP6mCzH3oT6CSHg6T13iDo1zOtzQyv1pJo='
WHERE
key_id = 'e978cb16b9ab7398c7d8966f46003c9e5c7c0b20876862e83cf73c35d3b659dc'
AND (
token = '84r0MbxF5EP6mCzH3oT6CSHg6T13iDo1zOtzQyv1pJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)