UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LP3QdIiO+hE6Tfy5fKuHg+1HGGai1FQmn3Nk5KwTINI='
WHERE
key_id = '1bd7043bade1da4c6e422b13586b84aaabbb215120de738969e54b372cb2d4d5'
AND (
token = 'LP3QdIiO+hE6Tfy5fKuHg+1HGGai1FQmn3Nk5KwTINI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)