UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+E7/kCtPDfNWQyd3K+ZLnw+1rT+Fq/GFe0oTNcu1KkQ='
WHERE
key_id = '5d3d28cbf6f60bcf89039d6d978958bbc140e8d8a2f7660940d668475f1e6528'
AND (
token = '+E7/kCtPDfNWQyd3K+ZLnw+1rT+Fq/GFe0oTNcu1KkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)