UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IjdiY5GvTIaQ8oSkpletTOWpj1nz5p+wnLtBfaC+wEw='
WHERE
key_id = 'f7ac27b42ccc9619bc437de1e0f82107123f349536fd1fc3a17ad2df1424f12c'
AND (
token = 'IjdiY5GvTIaQ8oSkpletTOWpj1nz5p+wnLtBfaC+wEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)