UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's44Uzwf/J4VTI+VMagAh6ZnpeXi0cZKOZrzae8lBka0='
WHERE
key_id = '0873de7ea13e5c145d4bde0785221140d44bc71117bf3eaa96e29b3f31400aef'
AND (
token = 's44Uzwf/J4VTI+VMagAh6ZnpeXi0cZKOZrzae8lBka0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)