UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rlpbFv+R+bhdT86kHx8GYvLYmaHlHQtX2TiJetwEec='
WHERE
key_id = '833d4157146e444aea31b329a07b45a4b68951228863b2ae1140b24d7ab3b5ad'
AND (
token = '3rlpbFv+R+bhdT86kHx8GYvLYmaHlHQtX2TiJetwEec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)