UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5LjHEcHaCK3adY6LPdUT5WN1zPqFeRoAfHb9G5RloRw='
WHERE
key_id = '8114e578ee73cc8730c47f3e37d9ccee13a794f327a954c8258acea9c9cc6d57'
AND (
token = '5LjHEcHaCK3adY6LPdUT5WN1zPqFeRoAfHb9G5RloRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)