UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lE+F2P2wwYgA5i8KEvUnKYTKGGXyBdqhG+SuFriKHpI='
WHERE
key_id = 'ee845401e629e0c0ea9d00847ed2e5e3d3c5734e7d8d4b97dddf7b22581e30c1'
AND (
token = 'lE+F2P2wwYgA5i8KEvUnKYTKGGXyBdqhG+SuFriKHpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)