UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/VMZuZogRKZJsNkbHOsR5hsZMIA6cSpu7H/5f7sUkc='
WHERE
key_id = 'e6f278e99dce7b6aff65f2cc52005ac9e4ba44ef2aaa6021a4ed31f9efbf2df1'
AND (
token = 'W/VMZuZogRKZJsNkbHOsR5hsZMIA6cSpu7H/5f7sUkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)