UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/2RWAaOJbA8GIcimqmDhFh98BgvEiIQ9WzrPKzMuQIQ='
WHERE
key_id = '7aadcf360a2ffa0ac459be4c0ad9cf5278545862244166eba30de18ba472fad4'
AND (
token = '/2RWAaOJbA8GIcimqmDhFh98BgvEiIQ9WzrPKzMuQIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)