UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yefogGmYNAYHF8I5xhL+kxb9nCN8qm4zR/Y0e9XU9G8='
WHERE
key_id = '06016233ee71fa7bff2080a34dec5fee3b4f2ddada74ce121ca6c5d0ed872191'
AND (
token = 'yefogGmYNAYHF8I5xhL+kxb9nCN8qm4zR/Y0e9XU9G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)